package com.xms.dependency.service;

import com.xms.dependency.XmsDependencyException;

import java.util.UUID;

/**
 * <p>
 * 依赖项检测
 * </p>
 *
 * @author migo
 * @since 2021/10/23
 */
public interface IDependencyChecker {
    /**
     * 检测并抛出异常(如果存在依赖)
     * @param requiredComponentType 被依赖对象类型
     * @param requiredId 被依赖组件类型
     * @param <TRequired> 被依赖对象主键
     */
    void checkAndThrow(int requiredComponentType, UUID requiredId) throws XmsDependencyException;

    /**
     * 检测并抛出异常(如果存在依赖)
     * @param requiredComponentName 被依赖对象类型
     * @param requiredId 被依赖组件类型
     * @param <TRequired> 被依赖对象主键
     */
    void checkAndThrow(String requiredComponentName, UUID requiredId) throws XmsDependencyException;
}
